<?php
$oUsers = UserHandler::getUsers();
$oJobs = JobHandler::getJobs();
$oUsergroups = UsergroupHandler::getUsergroups();
$sHisUsergroups = UserHandler::getUsergroups($_REQUEST['iUser']);
?>
<table class="boxborder" cellspacing="0">
	<tr>
		<td class="boxhandle" colspan="2"><?php print msg('User information') ?></td>
	</tr>
	<tr>
		<td class="control small" colspan="2">
			<a href="index.php?sView=user-list"><?php print msg('Users') ?></a> | <a href="index.php?sView=usergroup-list"><?php print msg('Usergroups') ?></a> |
		</td>
	</tr>
	<tr>
		<td class="separator" colspan="2"><?php print msg('General') ?></td>
	</tr>
	<tr>
		<td class="fieldname"><?php print msg('Username') ?>:</td>
		<td class="fieldvalue"><?php print $oUsers[$_REQUEST['iUser']]->sUser ?></td>
	</tr>
	<tr>
		<td class="fieldname"><?php print msg('Full name') ?>:</td>
		<td class="fieldvalue"><?php print $oUsers[$_REQUEST['iUser']]->sFullname ?>&nbsp;</td>
	</tr>
	<tr>
		<td class="fieldname"><?php print msg('E-mail') ?>:</td>
		<td class="fieldvalue"><a href="mailto: <?php print $oUsers[$_REQUEST['iUser']]->sEmail ?>"><?php print $oUsers[$_REQUEST['iUser']]->sEmail ?></a>&nbsp;</td>
	</tr>
	<tr>
		<td class="fieldname"><?php print msg('Admin') ?>:</td>
		<td class="fieldvalue"><?php print ($oUsers[$_REQUEST['iUser']]->bAdmin ? msg('Yes') : msg('No')) ?></td>
	</tr>
	<tr>
		<td class="separator" colspan="2"><?php print msg('Usergroups') ?></td>
	</tr>
	<tr>
		<td class="clear" colspan="2">
			<table style="width: 100%;" cellspacing="0">
				<tr>
					<td class="listtop"><?php print msg('Group') ?></td>
					<td class="listtop"><?php print msg('Rights') ?></td>
				</tr>
<?php
foreach ($sHisUsergroups as $iThisUsergroup => $sThisAccess)
{
	?>
				<tr>
					<td class="listentity">
						<img src="images/<?php print $_SESSION['oUserVars']['images'] ?>/usergroup.png">
						<a href="index.php?sView=usergroup-view&iUsergroup=<?php print $iThisUsergroup ?>"><?php print $oUsergroups[$iThisUsergroup]->sName ?></a></td>
					<td class="listentity"><?php print ($sThisAccess == 'admin' ? msg('Group admin') : msg('User')) ?></td>
				</tr>
	<?php
}
?>
			</table>
		</td>
	</tr>
</table>
